<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js">var CLS_NUMBER = &#39;x-grid-rownumber&#39;;
<span id='BUI-Grid-Plugins-RowNumber'>/**
</span> * @class BUI.Grid.Plugins.RowNumber
 * 表格显示行序号的插件
 */
function RowNumber(config){
  RowNumber.superclass.constructor.call(this, config);
}

BUI.extend(RowNumber,BUI.Base);

RowNumber.ATTRS = 
{
<span id='BUI-Grid-Plugins-RowNumber-property-width'>  /**
</span>  * column&#39;s width which contains the row number
  */
  width : {
    value : 40
  },
<span id='BUI-Grid-Plugins-RowNumber-property-column'>  /**
</span>  * @private
  */
  column : {
    
  }
};

BUI.augment(RowNumber, 
{
  //创建行
  createDom : function(grid){
    var _self = this;
    var cfg = {
          title : &#39;&#39;,
          width : _self.get(&#39;width&#39;),
          fixed : true,
          resizable:false,
          sortable : false,
          renderer : function(value,obj,index){return index + 1;},
          elCls : CLS_NUMBER
      },
      column = grid.addColumn(cfg,0);
    _self.set(&#39;column&#39;,column);
  }
});

module.exports = RowNumber;
</pre>
</body>
</html>
